<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- 不带参数 -->
       <button @click="btn1"> 按钮1</button>
       <button @click="btn2()"> 按钮2</button>

       <!-- 带参数 -->
       <button @click="btn3(1,3)"> 按钮3</button>

       <!-- 带参数 加 事件对象 -->
       <button @click="btn4(true, $event)"> 按钮4</button>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        const app = Vue.createApp({
            data() {
                return {
                    msg: ""
                }
            },
            methods: {
                btn1(params){
                    console.log(params);
                },
                btn2(params){
                    console.log(params);
                },
                btn3(params, params1){
                    console.log(params, params1);
                },
                btn4(params, event){
                    console.log(params, event);
                },
            },
        }).mount("#app");
    </script>
</body>
</html>